package com.yangtao.framework.hibernate;

import org.hibernate.HibernateException;
import org.hibernate.cfg.Configuration;
import org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean;

/**
 * @auther: 杨涛
 * Date: 11-5-9
 * Time: 下午11:28
 * @version: 1.0
 */
public class CustomSessionFactoryBean extends AnnotationSessionFactoryBean {
	protected Configuration newConfiguration() throws HibernateException {
		Configuration config = super.newConfiguration();
		//增加自己定义的主键生成器
		config.getIdentifierGeneratorFactory().register("pool", CustomIdGenerator.class);
		return config;
	}
}
